<!DOCTYPE HTML>
<html lang="zh-tw" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>布尔处理类指令 | 51 单片机笔记</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.5.2">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../2-interruption/index.html" />
    
    
    <link rel="prev" href="../1-basic/控制转移类指令.html" />
    

        
    </head>
    <body>
        
        
    <div class="book" data-level="1.8" data-chapter-title="布尔处理类指令" data-filepath="1-basic/布尔处理类指令.md" data-basepath=".." data-revision="Sat Nov 14 2015 21:21:46 GMT+0800 (CST)">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        简介
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="1-basic/index.html">
            
                
                    <a href="../1-basic/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        基础知识
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="1-basic/51单片机引脚.html">
            
            <span><b>1.1.</b> 51单片机引脚</span>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="1-basic/符号注释.html">
            
                
                    <a href="../1-basic/符号注释.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        符号注释
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="1-basic/寻址方式.html">
            
                
                    <a href="../1-basic/寻址方式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        寻址方式
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="1-basic/数据传送类指令.html">
            
                
                    <a href="../1-basic/数据传送类指令.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        数据传送类指令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="1-basic/算术运算类指令.html">
            
                
                    <a href="../1-basic/算术运算类指令.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        算术运算类指令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="1-basic/逻辑运算类指令.html">
            
                
                    <a href="../1-basic/逻辑运算类指令.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        逻辑运算类指令
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="1-basic/控制转移类指令.html">
            
                
                    <a href="../1-basic/控制转移类指令.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        控制转移类指令
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="1.8" data-path="1-basic/布尔处理类指令.html">
            
                
                    <a href="../1-basic/布尔处理类指令.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        布尔处理类指令
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="2-interruption/index.html">
            
                
                    <a href="../2-interruption/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        中断系统
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="2-interruption/中断允许寄存器.html">
            
                
                    <a href="../2-interruption/中断允许寄存器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        中断允许寄存器 IE
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="2-interruption/中断优先级寄存器.html">
            
                
                    <a href="../2-interruption/中断优先级寄存器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        中断优先级寄存器 IP
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="2-interruption/定时、计数器控制寄存器.html">
            
                
                    <a href="../2-interruption/定时、计数器控制寄存器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        定时/计数器控制寄存器 TCON
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="2-interruption/T、C的模式寄存器.html">
            
                
                    <a href="../2-interruption/T、C的模式寄存器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        T/C的模式寄存器 TMOD
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="2-interruption/中断处理过程.html">
            
                
                    <a href="../2-interruption/中断处理过程.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        中断处理过程
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="2-interruption/定时计数器.html">
            
                
                    <a href="../2-interruption/定时计数器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        定时计数器
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="3-communication/index.html">
            
                
                    <a href="../3-communication/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        串行通信
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="3-communication/几个知识点.html">
            
                
                    <a href="../3-communication/几个知识点.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        几个知识点
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="3-communication/几个用到的寄存器.html">
            
                
                    <a href="../3-communication/几个用到的寄存器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        几个用到的寄存器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="3-communication/串行通信过程及实例.html">
            
                
                    <a href="../3-communication/串行通信过程及实例.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        串行通信过程及实例
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="4-external/index.html">
            
                
                    <a href="../4-external/index.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        外部扩展
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="4-external/存储器的扩展.html">
            
                
                    <a href="../4-external/存储器的扩展.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        存储器的扩展
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="4-external/与外设的数据传输.html">
            
                
                    <a href="../4-external/与外设的数据传输.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        与外设的数据传输 8255
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="4-external/数模转换器.html">
            
                
                    <a href="../4-external/数模转换器.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        数模转换器 DAC0832
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="4-external/模数转换器.html">
            
            <span><b>4.4.</b> 模数转换器 ADC0809</span>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本書使用 GitBook 釋出
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >51 单片机笔记</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h3 id="&#x5E03;&#x5C14;&#x5904;&#x7406;&#x7C7B;&#x6307;&#x4EE4;"><span id="bool">&#x5E03;&#x5C14;&#x5904;&#x7406;&#x7C7B;&#x6307;&#x4EE4;</span></h3>
<hr>
<p>&#x53C2;&#x89C1; <a href="&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7C7B;&#x6307;&#x4EE4;.html">&#x903B;&#x8F91;&#x8FD0;&#x7B97;&#x7C7B;&#x6307;&#x4EE4;</a> &#x3002;</p>
<pre><code class="lang-51">MOV        C,        bit
MOV        bit,      C
</code></pre>
<pre><code class="lang-51">CLR         C
CLR         bit
SETB        C
SETB        bit
CPL         C
CPL         bit
ANL         C,    bit        ; (C) AND bit -&gt; C
ANL         C,    \bit    ; (C) AND &#xFFE2;bit -&gt; C
ORL         C,    bit
ORL         C,    \bit
</code></pre>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../1-basic/控制转移类指令.html" class="navigation navigation-prev " aria-label="Previous page: 控制转移类指令"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../2-interruption/index.html" class="navigation navigation-next " aria-label="Next page: 中断系统"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="https://cdn.mathjax.org/mathjax/2.5-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-mathjax/plugin.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"mathjax":{"forceSVG":false},"highlight":{},"search":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
